/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */
import { CheckLogin } from '@/api/CheckLogin'
import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/LayOut/Login/Login'
import Main from '../views/LayOut/Main/Main'
const routes = [
  {
    path: '/',
    name: "login",
    component: Login,
  },
  {
    path: '/index',
    name: "index",
    component:  () => import("../views/LayOut/Foreground/index.vue"),
    children:[
      {
        path: '/send',
        name: "send",
        component:  () => import("../views/LayOut/Foreground/send.vue")
      },
      {
        path: '/search',
        name: "search",
        component:  () => import("../views/LayOut/Foreground/search.vue")
      },
  ]
  },
  {
    path: '/register',
    name: "register",
    component: () => import("../views/LayOut/Login/Register.vue")
  },
  {
    path: '/main',
    name: "main",
    component: Main,
    //嵌套路由
    children: [
      {
        path: "/myinformation",
        name: "myinformation",
        component: () => import("../views/LayOut/Pages/Information/MyInformation.vue")
      },
      {
        path: "/cilentinformation",
        name: "cilentinformation",
        component: () => import("../views/LayOut/Pages/Information/CilentInformation.vue")
      },
      {
        path: "/staffinformation",
        name: "staffinformation",
        component: () => import("../views/LayOut/Pages/Information/StaffInformation.vue")
      },
      {
        path: "/inquireorders",
        name: "inquireorders",
        component: () => import("../views/LayOut/Pages/Orders/InquireOrders.vue")

      },
      {
        path: "/ourcars",
        name: "ourcars",
        component: () => import("../views/LayOut/Pages/Transportation/OurCars.vue")
      },
      {
        path: "/datacenter",
        name: "datacenter",
        component: () => import("../views/LayOut/Pages/Datacenter/DataCenter.vue")
      }

    ]

  }
]



const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
